package com.oak.interviewdemo.exception;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;

/**
 * 自定义异常类
 *
 * @Author: guoxy
 * @Date: 2020/5/18 9:41
 * @Description:
 * @Version: 1.0
 */
@Data
@AllArgsConstructor
public class GlobalException extends RuntimeException implements Serializable {

    private static final long serialVersionUID = 1L;

    private int code=500;
    private String msg;

    public GlobalException(String msg){
        this.msg = msg;
    }


    public GlobalException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

}